const db = wx.cloud.database()
let storeList = []
Page({

  data: {
    DataList: [],
    statusBarHeight:wx.getSystemInfoSync()['statusBarHeight']
  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onLoad(options) {
    // let res = await db.collection('masterList').get()
    // storeList = res.data.map(item=> {return [...item.wordList]})
    // this.setData({
    //     DataList:[].concat(...storeList)
    // })
    wx.startPullDownRefresh()
    let res = await wx.cloud.callFunction({
      name: 'getReviewList',
      data: {
        type: 'master',
        openid:wx.getStorageSync('userInfo').openid
      }
    })
    console.log('分类', res)
    //   obtWordList = res.result.list
    this.setData({
      DataList: res.result.list
    })
    wx.stopPullDownRefresh({
      success: (res) => {},
    })
  },

  transfer(e) {
    console.log('e', e)
    let id = e.target.dataset._id;
    console.log('id：', id)

    wx.navigateTo({ // 暂定为跳转提示页面
      url: '/pages/dictionary/wordDetail/wordDetail?content=' + id,
    })
  },

})